from .base import Base, db


class RoleOrg(Base):

    __tablename__ = 'role_org'

    role_code = db.Column(db.String(10), nullable=False)
    org_code = db.Column(db.String(10), nullable=False)

    def __init__(self, role_code, org_code, create_user, update_user):
        super(RoleOrg, self).__init__(create_user, update_user)
        self.role_code = role_code
        self.org_code = org_code

    def __repr__(self):
        desc = 'RoleOrg:{'
        for key in self.__dict__:
            desc += '%s:%s\n' % (key, self.__dict__[key])
        return desc % '}'
